# -*- coding:utf-8 -*-

from scrapy import Request

class SeleniumRequest(Request):

    def __init__(self, wait_time=None, wait_until=None, screenshot=False, script=None, *args, **kwargs):
        """Initialize a new selenium request.

        Args:
            wait_time (int, optional): The number of seconds to wait. Defaults to None.
            wait_until (function, optional): One of the "selenium.webdriver.support.expected_conditions".
                        The response will be returned until the given condition is fulfilled. Defaults to None.
            screenshot (bool, optional): If True, a screenshot of the page will be taken and the data of 
                        the screeenshot will be returned in the response "meta" attribute. Defaults to False.
            script (str, optional): JavaScript code to execute. Defaults to None.
        """
        self.wait_time = wait_time
        self.wait_until = wait_until
        self.screenshot = screenshot
        self.script = script

        super().__init__(*args, **kwargs)
